//
//  JOThreeViewController.m
//  navigation相关
//
//  Created by song on 15/1/21.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "JOThreeViewController.h"

@interface JOThreeViewController ()

@end

@implementation JOThreeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.navigationItem.title =@"第三个控制器";
    
    
    UIBarButtonItem *item1 =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
    
    UIBarButtonItem *item2 =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil];

    self.navigationItem.rightBarButtonItems = @[item1 ,item2];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)firstclick:(id)sender {
    //移除栈顶的控制器
    [self.navigationController  popViewControllerAnimated:YES];
    
}

- (IBAction)secondclick:(id)sender {
    [self.navigationController popToRootViewControllerAnimated:YES];
}
@end
